import Taro from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import styles from './index.module.scss'

import iconLike from '@/static/icons/like.svg'
import { useEffect } from 'react'

const RehabComplete = () => {
    useEffect(() => {
        Taro.hideHomeButton()
    }, [])

    const handleClick = () => {
        Taro.switchTab({
            url: '/pages/rehab/index',
        })
    }
    return (
        <View className={styles.container}>
            <View className={styles.icon}>
                <Image src={iconLike} />
            </View>
            <View className={styles.title}>恭喜你完成训练</View>
            <View className={styles.subTitle}>
                你已经完成了1次训练，恭喜获得
                <Text className={styles.bold}>最佳新人</Text>奖章
            </View>
            <View className={styles.horizon}></View>
            <View className={styles.data}>
                <View className={styles.dataItem}>
                    <View className={styles.dataItemValue}>10:00</View>
                    <View className={styles.dataItemLabel}>分钟</View>
                </View>
                <View className={styles.dataItem}>
                    <View className={styles.dataItemValue}>56</View>
                    <View className={styles.dataItemLabel}>卡路里</View>
                </View>
                <View className={styles.dataItem}>
                    <View className={styles.dataItemValue}>50</View>
                    <View className={styles.dataItemLabel}>次</View>
                </View>
            </View>
            {/* 按钮 */}
            <View className={styles.button} onClick={() => handleClick()}>
                <Text>主页</Text>
            </View>
        </View>
    )
}
export default RehabComplete
